package main;
import java.awt.Color;
import java.awt.Font;
import java.awt.Graphics;

import javax.swing.JPanel;


public class MenuItem 
{
	private String name;
	private Boolean selected = false;
	private JPanel panel;
	
	public MenuItem(JPanel j, String n)
	{
		panel = j;
		name = n;
	}
	
	public void paint(Graphics g, int size, int item)
	{
		if(selected)
		{
			g.setFont(new Font("Monospaced", 0, 20));
			g.setColor(Color.blue);
			g.fillRect(panel.getWidth()/2-name.length()/2, panel.getHeight()/2, name.length()*6, 30);
			g.setColor(Color.green);
			g.drawString(name, panel.getWidth()/2-name.length()/2, panel.getHeight()/2);
		}
		else
		{
			g.setFont(new Font("Monospaced", 0, 20));
			g.setColor(Color.green);
			g.fillRect(panel.getWidth()/2-name.length()*13/2, panel.getHeight()/2, name.length()*13, 30);
			g.setColor(Color.blue);
			g.drawString(name, panel.getWidth()/2-name.length()*13/2, panel.getHeight()/2+20);
		}
	}
	
	public String getName()
	{
		return name;
	}
}
